package com.zcckj.demo.order.provider;


import com.zcckj.demo.order.model.dto.OrderDTO;
import com.zcckj.demo.order.model.entity.Order;
import com.zcckj.demo.order.service.OrderService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

/**
 *
 * <p>
 *  订单写服务 暴露为Dubbo服务
 * </p>
 *
 * @author zhangjie
 * @since 2019-08-29
 */
@Service
public class OrderWriteServiceImpl implements OrderWriteService{
    @Autowired
    private OrderService orderService;

    @Override
    public Boolean createOrder(OrderDTO orderDTO) {
        Order order = new Order();
        BeanUtils.copyProperties(orderDTO,order);
        return orderService.save(order);
    }
}
